#nullable enable

//===================================================================
// 项目名 : Hbt.Cur
// 文件名 : HbtPcbaManhours.cs
// 创建者 : Lean365
// 创建时间: 2024-12-01
// 版本号 : V0.0.1
// 描述    : PCBA生产工数实体类
// 版权    : Copyright © 2024 Lean365. All rights reserved.
//===================================================================

using SqlSugar;
using System;
using System.Collections.Generic;

namespace Hbt.Domain.Entities.Logistics.Manufacturing.Manhours.Pcba
{
    /// <summary>
    /// PCBA生产工数实体类
    /// </summary>
    /// <remarks>
    /// 创建者: Lean365
    /// 创建时间: 2024-12-01
    /// 功能说明: 记录PCBA生产过程中的工数信息，包括贴片、焊接、测试等工序的工时数据
    /// </remarks>
    [SugarTable("hbt_logistics_execution_manhours_pcba", "PCBA生产工数表")]
    [SugarIndex("ix_pcba_prod_date", nameof(ProdDate), OrderByType.Asc, false)]
    [SugarIndex("ix_pcba_plant_code", nameof(PlantCode), OrderByType.Asc, false)]
    [SugarIndex("ix_pcba_prod_line", nameof(ProdLine), OrderByType.Asc, false)]
    [SugarIndex("ix_pcba_material_code", nameof(MaterialCode), OrderByType.Asc, false)]
    [SugarIndex("ix_pcba_batch_no", nameof(BatchNo), OrderByType.Asc, false)]
    public class HbtPcbaManhours : HbtBaseEntity
    {
        /// <summary>
        /// 工厂代码
        /// </summary>
        [SugarColumn(ColumnName = "plant_code", ColumnDescription = "工厂代码", Length = 8, ColumnDataType = "nvarchar", IsNullable = false)]
        public string PlantCode { get; set; } = string.Empty;

        /// <summary>
        /// 生产日期
        /// </summary>
        [SugarColumn(ColumnName = "prod_date", ColumnDescription = "生产日期", ColumnDataType = "date", IsNullable = false)]
        public DateTime ProdDate { get; set; }

        /// <summary>
        /// 生产线
        /// </summary>
        [SugarColumn(ColumnName = "prod_line", ColumnDescription = "生产线", Length = 20, ColumnDataType = "nvarchar", IsNullable = false)]
        public string ProdLine { get; set; } = string.Empty;

        /// <summary>
        /// 机种
        /// </summary>
        [SugarColumn(ColumnName = "model_type", ColumnDescription = "机种", Length = 50, ColumnDataType = "nvarchar", IsNullable = false)]
        public string ModelType { get; set; } = string.Empty;

        /// <summary>
        /// 物料编码
        /// </summary>
        [SugarColumn(ColumnName = "material_code", ColumnDescription = "物料编码", Length = 20, ColumnDataType = "nvarchar", IsNullable = false)]
        public string MaterialCode { get; set; } = string.Empty;

        /// <summary>
        /// 批次
        /// </summary>
        [SugarColumn(ColumnName = "batch_no", ColumnDescription = "批次", Length = 20, ColumnDataType = "nvarchar", IsNullable = false)]
        public string BatchNo { get; set; } = string.Empty;

        /// <summary>
        /// 投入工数(分钟)
        /// </summary>
        [SugarColumn(ColumnName = "input_minutes", ColumnDescription = "投入工数(分钟)", ColumnDataType = "decimal(10,2)", IsNullable = false, DefaultValue = "0")]
        public decimal InputMinutes { get; set; } = 0;

        /// <summary>
        /// 损失工数(分钟)
        /// </summary>
        [SugarColumn(ColumnName = "loss_minutes", ColumnDescription = "损失工数(分钟)", ColumnDataType = "decimal(10,2)", IsNullable = false, DefaultValue = "0")]
        public decimal LossMinutes { get; set; } = 0;

        /// <summary>
        /// 作业工数(分钟)
        /// </summary>
        [SugarColumn(ColumnName = "work_minutes", ColumnDescription = "作业工数(分钟)", ColumnDataType = "decimal(10,2)", IsNullable = false, DefaultValue = "0")]
        public decimal WorkMinutes { get; set; } = 0;


    }
}
